package org.coral.server.game.module.item.domain;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.coral.server.core.server.AbstractModuleMultiDomain;

import org.coral.server.game.module.resource.IResourceDomain;
import org.coral.server.game.module.resource.domain.ItemResourceDomain;

/**
* ItemDomain
* @author Jeremy
*/
	interf = "implements"

public class ItemDomain extends AbstractModuleMultiDomain<Long, Item>  IResourceDomain<Long, Item>{

	private static final Logger log = LoggerFactory.getLogger(ItemDomain.class);
	
	private static final int LIMIT = 999; 
	
	/**
	 * 资源代理对象
	 */
	private IResourceDomain<Long, Item> resourceDomainProxy;
	
	public ItemDomain(){
		
	}

	
	////////////业务代码////////////////////
	
	
	@Override
	public void afterInit() {
		this.resourceDomainProxy = ItemResourceDomain.create(playerId, getBeanMap());
	}
	
	@Override
	public Item getBeanByConfigId(int configId) {
		return resourceDomainProxy.getBeanByConfigId(configId);
	}

	//@Override
	//public Collection<Item> getBeansByConfigId(int configId) {
	//	return resourceDomainProxy.getBeansByConfigId(configId);
	//}

	@Override
	public boolean checkAdd(int configId, int count) {
		return resourceDomainProxy.checkAdd(configId, count);
	}

	@Override
	public List<Item> add(int configId, int count) {
		return resourceDomainProxy.add(configId, count);
	}

	@Override
	public boolean checkEnough(int configId, int count) {
		return resourceDomainProxy.checkEnough(configId, count);
	}

	@Override
	public boolean costByConfigId(int configId, int count) {
		return resourceDomainProxy.costByConfigId(configId, count);
	}

	@Override
	public boolean costById(Long id, int count) {
		return resourceDomainProxy.costById(id, count);
	}

	@Override
	public List<Item> getUpdateItemList() {
		return resourceDomainProxy.getUpdateItemList();
	}

	@Override
	public List<Item> getDeleteItemList() {
		return resourceDomainProxy.getDeleteItemList();
	}
}

